
<!-- content for head -->
<% content_for :head do %>
  <script type="text/javascript">
  </script>
<% end %>




      <div class="span12">


        <% @tasks.each do |task| %>
          <div class="well well-small">
          <h3><%= task[:keyword] %></h3>

          <p>
            您以 "<%= task[:keyword] %>" 为关键字进行搜索, 并且进行了<%= task.filtered_tasks.count - 1 %>次筛选.
          </p>

          <div class="">
            <table class="table table-hover">
              <thead>
                <tr>
                  <th>关键字</th>
                  <th>时间段</th>
                  <th>地区</th>
                  <th>结果</th>
                  <th></th>
                </tr>
              </thead>
              <tbody>
              <% task.filtered_tasks.each do |filtered_task| %>
                <tr>
                  <td><%= sns_type_tag(filtered_task.search_type) + "  " + filtered_task.keyword  %></td>
                  <td><%= time_filter_tag filtered_task  %></td>
                  <td><%= filtered_task.province  %> - <%= filtered_task.city %></td>
                  <td></td>
                  <td>
                  <div class="btn-group pull-right" data-toggle="buttons-checkbox">
                    <a href="<%= filtered_task._id %>" class="btn"  style='display:none'><i class="icon-remove"></i></a>
                    <a href="/histories/<%= filtered_task._id %>" target="blank" class="btn"><i class="icon-search"></i></a>
                    <a href="" class="btn" style='display:none'><i class="icon-star-empty"></i></a>
                  </div>
                  </td>
                </tr>
              <% end %>
              </tbody>
            </table>

          </div>



        </div>
        <% end %>



        <div class="pagination pagination-centered">
          <ul>
            <li class="active"><a href="?date=<%= date_str(-7).strftime('%Y-%m-%d') %>">&laquo;</a></li>
            <% 7.times do |_t| %>
              <% _t = 7 - _t %>
              <% ts = date_str(- _t + 4) %>
              <li class="<%= params[:date] == ts.strftime('%Y-%m-%d') ? 'disabled' : 'active' %>"><a href="?date=<%= ts.strftime('%Y-%m-%d') %>"><%= ts.strftime('%m-%d') %></a></li>
            <% end -%>
            <li class="active"><a href="?date=<%= date_str(+7).strftime('%Y-%m-%d') %>">&raquo;</a></li>
          </ul>
        </div>
      </div>
